

import ERP_ValiderChamps
from Tkinter import *
import tkMessageBox

class TestValider:
    def __init__(self, master): 
        self.validator=ERP_ValiderChamps.Validation()   
        frame = Frame(master)
        frame.pack(side=TOP, padx=50, pady=50)          
    
        self.button = Button(frame, text="QUIT", fg="red", command=frame.quit)
        self.button.pack(side=LEFT)
        
        self.hi_there = Button(frame, text="valider", command=self.validerTelephone)
        self.hi_there.pack(side=LEFT)
        
       # self.entryNom = Entry(frame)
        #self.entryNom.pack(padx=5)

        self.entryTelephone = Entry(frame)
        self.entryTelephone.pack(padx=5)
        
        
    '''def validerEntryNom(self):
        if self.validator.validerNom(self.entryNom):
             tkMessageBox.showinfo("", "Le nom entrer est valide")
        else:
             tkMessageBox.showinfo("", "Le nom entrer n'est pas valide ")'''
             
    def validerTelephone(self):
        phone=self.entryTelephone.get() 
        if self.validator.validerPhone(phone):
            tkMessageBox.showinfo("", "Le telephone entrer est valide")
        else:
             tkMessageBox.showinfo("", "Le telephone entrer n'est pas valide ")
        
               
''' BEGIN'''
root = Tk()
app = TestValider(root)


root.mainloop()





















